<html>
<head><meta charset="utf-8"><title>AAPCS32/64 definition of &quot;export&quot;?? · t-compiler/arm · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/index.html">t-compiler/arm</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/AAPCS32.2F64.20definition.20of.20.22export.22.3F.3F.html">AAPCS32/64 definition of &quot;export&quot;??</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="247047059"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/AAPCS32/64%20definition%20of%20%22export%22%3F%3F/near/247047059" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/AAPCS32.2F64.20definition.20of.20.22export.22.3F.3F.html#247047059">(Jul 24 2021 at 00:32)</a>:</h4>
<p>Bitfields compatible with C have been under discussion in <a href="https://github.com/rust-lang/rfcs/issues/3113">rfcs#3113</a>.<br>
In <a href="https://github.com/rust-lang/rfcs/pull/3113#discussion_r663330513">this comment</a> I outline some of the requirements for  Rust imposed by both C and specific processor architectures and quote a few lines of the AAPCS. The last line I quote mystifies me, though, because the context of wanting cross-lang compatibility suggests exporting, but this... kinda says "don't"? So I have concluded I don't know what "export" means in this context and how we should translate that to Rust. The full paragraph is</p>
<blockquote>
<p>The AAPCS does not allow exported interfaces to contain packed structures or bit-fields. However a scheme for laying out packed bit-fields can be achieved by reducing the alignment, A, in the above rules to below that of the natural container type. ARMCC uses an alignment of A=8 in these cases, but GCC uses an alignment of A=1.</p>
</blockquote>
<p>And it is found in <a href="https://developer.arm.com/documentation/ihi0042/j/?lang=en#aapcs32-section7-1-7">Procedure Call Standard for the Arm® Architecture - Arm C and C++ Language Mappings - Data Types - Bitfields</a>, which apparently on the GH rst version is <a href="https://github.com/ARM-software/abi-aa/blob/main/aapcs32/aapcs32.rst#id8">Section 8.1.7</a></p>
<p>Apparently similar verbiage is present here in <a href="https://github.com/ARM-software/abi-aa/blob/main/aapcs64/aapcs64.rst#bit-fields">aapcs64.rst Section 8.1.8</a>.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>